import React from "react";
import {Button, Grid} from "@material-ui/core";
import {AddRounded} from "@material-ui/icons";

import {EnhancedTable, Toolbar} from "../../../shared/components";

const ViewAllInventory = ({onAdd, onRowClick, ...props}) => {

    return (
        <Grid container spacing={4}>
            <Toolbar
                title="Parts Inventory"
                actions={<React.Fragment>
                    <Button
                        variant="contained"
                        color="primary"
                        startIcon={<AddRounded/>}
                        onClick={onAdd}
                    >
                        Add Parts Item
                    </Button>
                </React.Fragment>}
            />

            <Grid item xs={12}>
                <EnhancedTable
                    title={"Inventory List"}
                    schema={[
                        {id: 'id', label: 'Id', hidden: true},
                        {id: 'itemNumber', label: 'Item No.', sort: true},
                        {id: 'itemName', label: 'Item Name', sort: true},
                        {id: 'location', label: 'Location', sort: true},
                        {id: 'description', label: 'Description', sort: true},
                        {id: 'quantity', label: 'Quantity', sort: true},
                        {id: 'itemCost', label: 'Item Cost', sort: true},
                        {id: 'itemType', label: 'Item Type', sort: true},
                        {id: 'supplier', label: 'Supplier', sort: true},
                        {id: 'createDate', label: 'Create Date', sort: true}
                    ]}
                    data={[]}
                    onRowClick={onRowClick}
                />
            </Grid>
        </Grid>
    );
};

export default ViewAllInventory;
